//
//  LoginView.m
//  VEW
//
//  Created by lanou3g on 15/7/27.
//  Copyright (c) 2015年 Y团. All rights reserved.
//

#import "LoginView.h"
#import "LTView.h"

@interface LoginView ()

- (void)p_setupSubviews;

@end

@implementation LoginView

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
        self.backgroundColor = [UIColor whiteColor];
        [self p_setupSubviews];
    }
    return self;
}

- (void)p_setupSubviews
{
    UIImageView *imageview = [[UIImageView alloc] initWithFrame:self.bounds];
    imageview.image = [UIImage imageNamed:@"星空.jpg"];
    
    [self addSubview:imageview];
    
    _usernameView = [[LTView alloc] initWithFrame:CGRectMake(50, 220, 280, 50) description:@"用户名:" placeholder:@"请输入用户名"];
    [self addSubview:_usernameView];
    
    _passwordView = [[LTView alloc] initWithFrame:CGRectMake(50, 280, 280, 50) description:@"密    码:" placeholder:@"请输入密码"];
    [self addSubview:_passwordView];
    
    _loginButton = [UIButton buttonWithType:UIButtonTypeSystem];
    _loginButton.frame = CGRectMake(85, 370, 200, 40);
//    [_loginButton setImage:[[UIImage imageNamed:@"login_button"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];
    [_loginButton setTitle:@"登录" forState:UIControlStateNormal];
    [_loginButton setBackgroundColor:[UIColor whiteColor]];
    _loginButton.layer.cornerRadius=8;
    [self addSubview:_loginButton];
    
    _registButton = [UIButton buttonWithType:UIButtonTypeSystem];
    _registButton.frame = CGRectMake(145, 470, 80, 40);
    [_registButton setTitle:@"创建账户" forState:UIControlStateNormal];
    [_registButton setBackgroundColor:[UIColor lightGrayColor]];
    _registButton.layer.cornerRadius=8;
    [self addSubview:_registButton];
    
}


@end
